<?php
$tweet_user = $options['tweet_user'];
$tweet_pass = $options['tweet_pass'];
if(empty($posturl)){$posturl = get_permalink($postid);}

$twit = new tweeted();
$twit->user = $tweet_user;
$twit->pass = $tweet_pass;
$twit->msg = get_the_title($postid);
$twit->url = $posturl;
$result = $twit->updatestatus();
//$result = 'http://localhost/'; //test
//$save = $result; //test
if($result){
	$data = new SimpleXMLElement($result);	
	$save = $data->id;
	$save = 'http://twitter.com/'.$user.'/status/'.$save;
	update_post_meta($postid, 'tweet', $save);
}
?>